<div id="roleLayout" class="xy-layout">
    <div class="xy-layout-center" data-options="region:'center',border:false,minWidth:400">
        <!--datagrid 表格，表示用户-->
        <div class="layui-colla-item">
            <!--标题-->
            <div class="layui-colla-title">
                <div class="xy-toolbar">
                    <div class="xy-toolbar-btn">
                        <button class="layui-btn layui-btn-sm" data-type="add"><i class="layui-icon"></i>修改
                        </button>
                        <button class="layui-btn layui-btn-sm" data-type=""><i class="layui-icon">&#xe654;</i>添加
                        </button>
                        <button class="layui-btn layui-btn-sm" data-type=""><i class="layui-icon"></i>删除
                        </button>
                    </div>

                    <div class="xy-toolbar-search">
                        <div class="layui-input-inline">
                            <input type="text" name="name" placeholder="支持模糊查询.." autocomplete="off"
                                   class="layui-input"/>
                        </div>
                        <button lay-filter="search" class="layui-btn layui-btn-sm" data-type="search">
                            <i class="layui-icon">&#xe615;</i>查询
                        </button>
                    </div>
                </div>
            </div>
            <!--内容-->
            <div class="layui-colla-content layui-show xy-table">
                <table class="layui-hide" lay-filter="test" id="roleData"></table>
            </div>

        </div>
    </div>
</div>
<script>
    $(function () {
        layout.initLayout("#roleLayout",{fit: true})
    });
    //JavaScript代码区域
    layui.use(['element', 'tree', 'jquery', 'table'], function () {
        var element = layui.element, $ = layui.jquery, table = layui.table;
        //第一个实例
        table.render({
            elem: '#roleData'
            , height: 'full-185'
            , url: '/structure/listUserByStructure' //数据接口
            , even: true
            , skin: 'row'
            , id: 'roleData'
            , cols: [[ //表头
                {type: 'numbers'}
                , {type: 'checkbox'}
                , {field: 'id', title: 'ID', width: 80, sort: true}
                , {field: 'username', title: '用户名', width: 80}
                , {field: 'sex', title: '性别', width: 80, sort: true}
                , {field: 'sign', title: '签名', width: 177}
                , {field: 'experience', title: '积分', width: 80, sort: true}
                , {field: 'score', title: '评分', width: 80, sort: true}
            ]]
            , page: true //开启分页
            , done: function (res, curr, count) {//数据渲染完成后的回掉函数

            }
        });
    })
</script>